import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import store from './store/store.js' //导入并挂载
import 'animate.css';
import {$http} from '@escook/request-miniprogram'
uni.$http=$http
$http.baseUrl='https://api.zhuti.xiaomi.com'
$http.beforeRequest=function(options){
    if(options.url.indexOf('/home/home'||'/cate/cata')!==-1){
      options.header={
        "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
      }
    }
    uni.showLoading({
      title:"加载中..."
    })
}
$http.afterRequest=function(){
  uni.hideLoading()
}
uni.$showMsg=function(title='数据请求失败',duration=1500){
  uni.showToast({
    title,
    duration,
    icon:'none'
  })
}

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App,
    store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif